package arithmeticoperator;

public class LogicalOperator {
    public static void main(String[] args) {
        System.out.println("--------逻辑运算符--------");
        //逻辑运算符 或 | 且 & 非 ! 异或 ^
        int a = 10;
        int b = 20;
        //异或  相同为false 不同为true
        System.out.println(a == 10 ^ b == 10);
        //& 逻辑与  有false 则false
        System.out.println(a > b && a > 10);
        //| 逻辑或  有true 则true
        System.out.println(a > b || a == 10);
        //三元运算符
        System.out.println(a > 9 ? "a>9" : "a<9");
    }
}
